import request from '@/utils/request'
/*
* 获取货品列表的接口
*  */
export const fetchCargoListAPI = (orderId) => {
  return request({
    url: '/manager/order-manager/cargo',
    method: 'GET',
    params: {
      orderId
    }
  })
}
/*
* 删除货物的接口
*  */
export const deleteCargoAPI = (id) => {
  return request({
    url: `/manager/order-manager/cargo/${id}`,
    method: 'DELETE'
  })
}
/*
* 获取货物类型信息列表的接口
*  */
export const fetchCargoTypeAPI = () => {
  return request({
    url: '/manager/goodsType/simple',
    method: 'GET'
  })
}

/*
*
* 添加货物的接口
*  */
export const addCargoAPI = (data) => {
  return request({
    url: '/manager/order-manager/cargo',
    method: 'POST',
    data
  })
}

/*
* 更新货物信息的接口
*  */
export const updateCargoAPI = (data) => {
  return request({
    url: `/manager/order-manager/cargo/${data.id}`,
    method: 'PUT',
    data
  })
}
